package cn.iocoder.yudao.module.brokerage.merchant.api;

import cn.iocoder.yudao.module.api.brokerage.agency.BrokerageAgencyApi;
import cn.iocoder.yudao.module.api.brokerage.agency.vo.AgencyBrokerageMoneyTrendVO;
import cn.iocoder.yudao.module.api.brokerage.agency.vo.AgencyBrokerageSummaryVO;
import cn.iocoder.yudao.module.api.member.agency.vo.AgencyUserVO;
import cn.iocoder.yudao.module.brokerage.merchant.service.AdminBrokerageMerchantService;
import cn.iocoder.yudao.module.brokerage.merchant.service.AppBrokerageMerchantService;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/03/10
 */
@Service
@Validated
public class BrokerageAgencyApiImpl implements BrokerageAgencyApi {
    @Resource
    private AdminBrokerageMerchantService adminBrokerageMerchantService;
    @Resource
    private AppBrokerageMerchantService appBrokerageMerchantService;

    @Override
    public boolean bindRelation(@Nonnull Long shopId, @Nonnull Long agencyUserId) {
        return adminBrokerageMerchantService.bindRelation(shopId, agencyUserId);
    }

    @Nonnull
    @Override
    public AgencyBrokerageSummaryVO getSummary(Long userId) {
        return appBrokerageMerchantService.getSummary(userId);
    }

    @Override
    public List<AgencyBrokerageMoneyTrendVO> getBonusMoneyTrend(Long userId, LocalDateTime beginTime, LocalDateTime endTime) {
        return appBrokerageMerchantService.getBonusMoneyTrend(userId, beginTime, endTime);
    }

    @Override
    public AgencyUserVO getAgencyUserByShopId(Long shopId) {
        return appBrokerageMerchantService.getAgencyUserByShopId(shopId);
    }

}
